package com.cskaoyan.javase.oop1._7game._1pvz;

/**
 * 用面向对象的思想模拟植物大战僵尸
 * plant vs zombie  (pvz)
 * 植物对象 僵尸对象
 * 所以需要植物类 僵尸类
 *
 * @since 10:15
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Test {
    public static void main(String[] args) {
        Plant pea = new Plant("豌豆射手", 100, 1000, 200);
        Zombie normal = new Zombie("普通僵尸", 2000, 100, 777);
        // 给对象中持有的引用赋值
        pea.plantZ = normal;
        normal.zombieP = pea;
        System.out.println("Game Start~");
        normal.move();
        pea.attack();
        normal.beAttacked();
        System.out.println("僵尸历尽重重艰难,来到了" + pea.name + "的身边~");
        normal.attack();
        pea.beAttacked();
        System.out.println(pea.name + "牺牲了," + normal.name + "来了~~");
        normal.eat();
        System.out.println("Game Over~~");
    }
}
